
<div style="margin-bottom:5px;margin-top:5px;padding-left:500px">

    <a target="_blank" href="http://www.facebook.com/sharer.php?u=<?php echo $root_page . $url; ?>">
        <img border="0" align="absmiddle" title="Facebook" src="<?php echo $sub_domain; ?>/images/them1/icon_chat/facebook.png"/>
    </a> <a target="_blank" href="http://twitter.com/home?status=<?php echo $root_page . $url; ?>">
        <img border="0" align="absmiddle" title="Twitter" src="<?php echo $sub_domain; ?>/images/them1/icon_chat/twitter.png"/>
    </a> <a target="_blank" href="https://www.google.com/bookmarks/mark?op=add&amp;bkmk=<?php echo $root_page . $url; ?>&amp;title=<?php echo $root_page . $url; ?>">
        <img border="0" align="absmiddle" title="Google Bookmark" src="<?php echo $sub_domain; ?>/images/them1/icon_chat/google.png"/>
    </a> <a target="_blank" href="http://del.icio.us/post?v=2&amp;url=<?php echo $root_page . $url; ?>&amp;notes=&amp;tags=&amp;title=<?php echo $root_page . $url; ?>">
        <img border="0" align="absmiddle" title="Delicious" src="<?php echo $sub_domain; ?>/images/them1/icon_chat/delicious.png"/></a>
    <a target="_blank" href="http://digg.com/submit?phase=2&amp;url=<?php echo $root_page . $url; ?>&amp;title=<?php echo $root_page . $url; ?>">
        <img border="0" align="absmiddle" title="Digg" src="<?php echo $sub_domain; ?>/images/them1/icon_chat/digg.png"/>
    </a>
    <a rel="nofollow" target="_blank" href="http://www.myspace.com/index.cfm?fuseaction=postto&amp;u=<?php echo $root_page . $url; ?>">
        <img border="0" align="absmiddle" title="My Space" src="<?php echo $sub_domain; ?>/images/them1/icon_chat/mySpace.jpg"/>
    </a>
    <a rel="nofollow" target="_blank" href="http://linkhay.com/submit?link_url=<?php echo $root_page . $url; ?>">
        <img border="0" align="absmiddle" title="Link hay" src="<?php echo $sub_domain; ?>/images/them1/icon_chat/btn_linkhay.gif"/>
    </a>
</div>

<div style="clear:both"></div>

<div id="">
    <div class="listtitle">


        <table cellpadding="0" cellspacing="0" width="100%">
            <col width="50%">
            <col width="25%">
            <col width="25%">
            <tr>
                <td>
                    <div class="left2">
                        Sản phẩm <span> &gt; </span>
                        <?php foreach ($categoryParent as $key => $value) {
 ?>
<?php if ($key > 0) { ?>
                                <span> &gt; </span>
<?php } ?>
                            <a href="<?php echo $root_page;?>/danhmuc/<?php echo $value['category_id']; ?>/<?php echo $value['category_name_filter']; ?>.html" title="<?php echo $value['category_name']; ?>"><?php echo $value['category_name']; ?></a>
<?php } ?>
                    </div>

                </td>   
                <td>
                    <div class="left">
                        <div class="grid-new">
                            <span style="">Hiển thị theo:</span>
                            <span class="<?php echo ($listType == 1) ? 'active' : ''; ?>"><a class="grid-r" rel="1" onclick="MyController.getListProduct('list', 1);"></a></span>
                            <span class="<?php echo ($listType == 2) ? 'active' : ''; ?>"><a href="javascript:;" class="grid-c" rel="2" onclick="MyController.getListProduct('list', 2);"></a></span>
                        </div>
                    </div>
                </td>
                <td>
                    <div class="left">
                        <div class="list_order">
                            <a class="price_up <?php echo ($cookieOrder == 'price_up') ? 'selected' : ''; ?>" onclick="MyController.setOrder('price_up');">Giá</a> &nbsp;|&nbsp; <a class="price_down <?php echo ($cookieOrder == 'price_down') ? 'selected' : ''; ?>" onclick="MyController.setOrder('price_down');">Giá</a> &nbsp;|&nbsp; <a class="<?php echo ($cookieOrder == 'name_up') ? 'selected' : ''; ?>" onclick="MyController.setOrder('name_up');">A-Z</a>&nbsp;|&nbsp; <a class="<?php echo ($cookieOrder == 'name_down') ? 'selected' : ''; ?>" onclick="MyController.setOrder('name_down');">Z-A</a>
                        </div>
                    </div>
                </td>
            </tr>
        </table>


    </div>

    <div id="">
<?php if ($listType == 1) { ?>
                            <div class="list2">
<?php foreach ($aryProduct as $key => $product) { ?>
                                <div class="item">
                                    <div class="left">
                                        <div class="border">
<?php if ($product['product_type_id'] == 1) { ?>
                                    <div class="image_new">&nbsp;</div>
<?php } ?>
                                <div class="image">
                                    <div class="divvalign">
                                        <div class="divvalign2">
                                            <a href="<?php echo $root_page;?>/sanpham/<?php echo $product['product_id']; ?>/<?php echo $product['product_title_filter']; ?>.html" title="<?php echo $product['product_title']; ?>">
                                                <img src="<?php echo $sub_domain; ?>/images/common/grey.gif" data-original="<?php echo $sub_domain;?>/images/upload/thumbnail/<?php echo $product['product_main_image']; ?>" alt="<?php echo $product['product_title_filter']; ?>" title="<?php echo $product['product_title']; ?>"/></a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="right">
                            <div class="col2">
                                <div class="name">
                                    <a href="<?php echo $root_page;?>/sanpham/<?php echo $product['product_id']; ?>/<?php echo $product['product_title_filter']; ?>.html" title="<?php echo $product['product_title']; ?>"><?php echo $product['product_title']; ?></a>

                                </div>
                                <div class="item_highlight">
<?php echo $product['product_highlight']; ?>
                            </div>
                            <div><a class="showall" href="<?php echo $root_page;?>/sanpham/<?php echo $product['product_id']; ?>/<?php echo $product['product_title_filter']; ?>.html" title="<?php echo $product['product_title']; ?>">Xem chi tiết</a></div>
                        </div>
                        <div style="display: block;" class="col3">
                            <div class="top">
<?php if ($product['product_price_active_km'] == 1) { ?>
                                    <div class="price">
                                        Giá cũ : <span class="price_older"><?php echo number_format($product['product_price_vnd'], 0, ',', '.'); ?>&nbsp;VNĐ</span>
                                    </div>
                                    <div class="price">
                                        Giá KM : <span class="number"><?php echo number_format($product['product_price_vnd_km'], 0, ',', '.'); ?>&nbsp;VNĐ</span>
                                    </div>
<?php } else { ?>
                                    <div class="price">
                                        Giá bán : <span class="number"><?php echo ($product['product_price_vnd'] != 0) ? number_format($product['product_price_vnd'], 0, ',', '.') . '&nbsp;VNĐ' : '<a onclick="MyController.OverlayChat();" style="color: red;">Call</a>'; ?></span>
                                    </div>
<?php } ?>
                                <div class="vat">
<?php echo ($product['product_is_vat'] == 1) ? 'Đã bao gồm VAT' : 'Chưa bao gồm VAT'; ?>
                            </div>

                            <div align="center" style="padding-left: 10px;">
<?php if (in_array($product['product_id'], $aryOrderProductId)) { ?>
                                    <div>
                                        Đã có trong giỏ hàng
                                    </div>
                                    <div>
                                        <a href="<?php echo $root_page;?>/order/chi-tiet-gio-hang.html" title="Xem giỏ hàng">Xem giỏ hàng</a>
                                    </div>
<?php } else { ?>
                                    <div id="product_order_<?php echo $product['product_id']; ?>">
                                        <div class="btnorder" onclick="MyController.addProductToShopCat(<?php echo $product['product_id']; ?>, <?php echo $product['product_category_id']; ?>);"></div>
                                    </div>
<?php } ?>

                            </div>
                        </div>
                        <div class="under">
                            <div class="bullet_pro">
<?php echo $product['product_promotional']; ?>
                            </div>

                            <div align="center" style="padding-top: 20px;">
<?php if ($aryCustomer['customer_id'] == '') { ?>
                                    <a style="cursor: pointer" onclick="MyController.overlayLogin();" title="Vui lòng đăng nhập để mua hàng."><img style="vertical-align: middle;" src="<?php echo $sub_domain;?>/images/maccathue/button_mct.png"></a>
<?php } else { ?>
                                    <a style="cursor: pointer" onclick="MyController.sendLinkPrice('<?php echo $product['product_title']; ?> - Giá:&nbsp;<?php echo number_format($product['product_price_vnd'], 0, ',', '.') . '&nbsp;VNĐ' ?>', <?php echo $product['product_id']; ?>);" title="Bạn muốn mua sản phẩm với giá rẻ hơn?"><img style="vertical-align: middle;" src="<?php echo $sub_domain;?>/images/maccathue/button_mct.png"></a>
<?php } ?>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="clear">
                </div>
            </div>
<?php } ?>


                        </div>
<?php } if ($listType == 2) { ?>

                            <div class="list">
                                <table cellspacing="0" cellpadding="0" border="0">
                                    <tbody>
                                        <tr>
                        <?php $i = 1;
                            foreach ($aryProduct as $key => $product) { ?>
                                <td valign="bottom">
                                    <div class="item">

                                <?php
                                $productHiglight = str_replace("\n", '<br>', $product['product_highlight']);
                                $productHiglight = str_replace("\r", '<br>', $productHiglight);
                                $productHiglight = str_replace("\"", '', $productHiglight);

                                $product_promotional = str_replace("\n", '<br>', $product['product_promotional']);
                                $product_promotional = str_replace("\r", '<br>', $product_promotional);
                                $product_promotional = str_replace("\"", '', $product_promotional);
                                ?>

                                        <div class="list" >
                                    <a class="tooltip" href="<?php echo $root_page ?>/sanpham/<?php echo $product['product_id']; ?>/<?php echo $product['product_title_filter']; ?>.html">
<?php if ($product['product_type_id'] == 1) { ?>
                                            <div class="image_empty">
                                                &nbsp;</div>
<?php } ?>

                                        <div class="image">
                                            <div class="divvalign">
                                                <div class="divvalign2">
                                                    <img src="<?php echo $sub_domain; ?>/images/common/grey.gif" data-original="<?php echo $sub_domain;?>/images/upload/thumbnail/<?php echo $product['product_main_image']; ?>" alt="<?php echo $product['product_title_filter']; ?>" title="<?php echo $product['product_title']; ?>">
                                                </div>
                                            </div>
                                        </div>
                                    </a>
                                    <div class='name'>
                                        <a href="<?php echo $root_page;?>/sanpham/<?php echo $product['product_id']; ?>/<?php echo $product['product_title_filter']; ?>.html" title="<?php echo $product['product_title']; ?>">
<?php echo $product['product_title']; ?>
                                        </a>
                                    </div>
<?php if ($product['product_price_vnd_km'] != 0 && $product['product_price_active_km'] == 1) { ?>
                                            <div style="text-decoration: line-through;">
<?php echo number_format($product['product_price_vnd_km'], 0, ',', '.') . '&nbsp;VNĐ'; ?>
                                        </div>
                                        <div class="price">
<?php echo number_format($product['product_price_vnd'], 0, ',', '.') . '&nbsp;VNĐ' ?>
                                        </div>
<?php } else { ?>
                                            <div class="price">
<?php echo ($product['product_price_vnd'] != 0) ? number_format($product['product_price_vnd'], 0, ',', '.') . '&nbsp;VNĐ' : '<a onclick="MyController.OverlayChat();" style="color: red;">Call</a>'; ?>
                                        </div>
<?php } ?>
                                    </div>
                                </div>
                                    <pre class="hidden"><?php echo $product['product_title'];?><img class="img_tooltip" title="<?php echo $sub_domain;?>/images/upload/large/<?php echo $product['product_large_image']; ?>"></pre>
                            </td>
<?php if ($i % 5 == 0) { ?>
                                        </tr><tr>
                        <?php } ?>
<?php $i++;
                                    } ?>

                                </tr>
                            </tbody>
                        </table>
                    </div>
<?php } ?>
<?php echo $strPaging; ?>
                            </div>
                        </div>
